<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>ubuntu18.04 新手踩雷 | 月藤的博客</title>
    <meta name="generator" content="VuePress 1.8.0">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.min.css">
    <meta name="description" content="简单的介绍">
    
    <link rel="preload" href="/assets/css/0.styles.a2e941e0.css" as="style"><link rel="preload" href="/assets/js/app.c7d9ff18.js" as="script"><link rel="preload" href="/assets/js/2.cd56dec9.js" as="script"><link rel="preload" href="/assets/js/5.80c2b38b.js" as="script"><link rel="prefetch" href="/assets/js/10.21f484f8.js"><link rel="prefetch" href="/assets/js/11.5e166696.js"><link rel="prefetch" href="/assets/js/12.c56c19a2.js"><link rel="prefetch" href="/assets/js/13.3e31b609.js"><link rel="prefetch" href="/assets/js/14.3db3e5e6.js"><link rel="prefetch" href="/assets/js/15.cc75d7c3.js"><link rel="prefetch" href="/assets/js/16.5546d343.js"><link rel="prefetch" href="/assets/js/17.69b8a0f2.js"><link rel="prefetch" href="/assets/js/18.271396c8.js"><link rel="prefetch" href="/assets/js/19.bd4b0386.js"><link rel="prefetch" href="/assets/js/20.4a48d936.js"><link rel="prefetch" href="/assets/js/21.23862f34.js"><link rel="prefetch" href="/assets/js/22.95b3bd0a.js"><link rel="prefetch" href="/assets/js/23.d7c85d8e.js"><link rel="prefetch" href="/assets/js/24.c6d6dd3c.js"><link rel="prefetch" href="/assets/js/25.bb664de8.js"><link rel="prefetch" href="/assets/js/26.619789c7.js"><link rel="prefetch" href="/assets/js/27.54beb19d.js"><link rel="prefetch" href="/assets/js/28.8d77923a.js"><link rel="prefetch" href="/assets/js/29.7a771891.js"><link rel="prefetch" href="/assets/js/3.a0dd59cc.js"><link rel="prefetch" href="/assets/js/30.73e03cd7.js"><link rel="prefetch" href="/assets/js/31.a9a1ae37.js"><link rel="prefetch" href="/assets/js/32.66082a76.js"><link rel="prefetch" href="/assets/js/33.73a91496.js"><link rel="prefetch" href="/assets/js/34.da867ae2.js"><link rel="prefetch" href="/assets/js/35.6fac5ae2.js"><link rel="prefetch" href="/assets/js/36.0d6f5d22.js"><link rel="prefetch" href="/assets/js/37.c16a4955.js"><link rel="prefetch" href="/assets/js/38.3391e103.js"><link rel="prefetch" href="/assets/js/39.2e00541f.js"><link rel="prefetch" href="/assets/js/4.7f4b5eea.js"><link rel="prefetch" href="/assets/js/40.22b54e67.js"><link rel="prefetch" href="/assets/js/41.ea3ea4f8.js"><link rel="prefetch" href="/assets/js/42.3ae1db24.js"><link rel="prefetch" href="/assets/js/43.ecd8c202.js"><link rel="prefetch" href="/assets/js/44.f7609015.js"><link rel="prefetch" href="/assets/js/45.0db6f0b1.js"><link rel="prefetch" href="/assets/js/46.e28c1031.js"><link rel="prefetch" href="/assets/js/47.32d7164d.js"><link rel="prefetch" href="/assets/js/48.3aeaffda.js"><link rel="prefetch" href="/assets/js/49.33dab1c0.js"><link rel="prefetch" href="/assets/js/50.6e41bca8.js"><link rel="prefetch" href="/assets/js/51.37e89a7c.js"><link rel="prefetch" href="/assets/js/52.e60e1d45.js"><link rel="prefetch" href="/assets/js/53.7a9c00ba.js"><link rel="prefetch" href="/assets/js/54.a214a30e.js"><link rel="prefetch" href="/assets/js/6.133fd621.js"><link rel="prefetch" href="/assets/js/7.79403511.js"><link rel="prefetch" href="/assets/js/8.04726c3a.js"><link rel="prefetch" href="/assets/js/9.a86daf82.js">
    <link rel="stylesheet" href="/assets/css/0.styles.a2e941e0.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">月藤的博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://ziphold.gitee.io/blog/#/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  旧博客（停止更新）
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://rattonlzh.github.io/homepage/homepage.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  常用网址导航（停止更新）
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Select language" class="dropdown-title"><span class="title">Languages</span> <span class="arrow down"></span></button> <button type="button" aria-label="Select language" class="mobile-dropdown-title"><span class="title">Languages</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/配置记录/Ubuntu１８．０４新手踩雷.html" class="nav-link">
  zh-CN
</a></li><li class="dropdown-item"><!----> <a href="/en/" class="nav-link">
  en-US
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><div class="avatar"><img src="/assets/img/avatar.2b77755b.png" alt srcset></div> <div style="z-index: 999"><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="298" height="52" src="//music.163.com/outchain/player?type=2&id=28283137&auto=1&height=32"></iframe></div> <nav class="nav-links"><div class="nav-item"><a href="https://ziphold.gitee.io/blog/#/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  旧博客（停止更新）
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://rattonlzh.github.io/homepage/homepage.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  常用网址导航（停止更新）
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Select language" class="dropdown-title"><span class="title">Languages</span> <span class="arrow down"></span></button> <button type="button" aria-label="Select language" class="mobile-dropdown-title"><span class="title">Languages</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/配置记录/Ubuntu１８．０４新手踩雷.html" class="nav-link">
  zh-CN
</a></li><li class="dropdown-item"><!----> <a href="/en/" class="nav-link">
  en-US
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>随便说说</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>知识点总结</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>考研专区</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>读书笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发资料</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>配置记录</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/配置记录/apache服务器配置.html" class="sidebar-link">apache服务器配置</a></li><li><a href="/配置记录/elicpse配置.html" class="sidebar-link">elicpse配置</a></li><li><a href="/配置记录/install-sogou-im.html" class="sidebar-link">ubuntu18.04下安装搜狗输入法</a></li><li><a href="/配置记录/LAMP安装记.html" class="sidebar-link">LAMP实训</a></li><li><a href="/配置记录/lnmp安装.html" class="sidebar-link">一条命令开启lnmp</a></li><li><a href="/配置记录/Ubuntu１８．０４新手踩雷.html" class="active sidebar-link">ubuntu18.04 新手踩雷</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#制作启动盘" class="sidebar-link">制作启动盘</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#分配空间" class="sidebar-link">分配空间</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#u盘启动" class="sidebar-link">U盘启动</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#安装建议" class="sidebar-link">安装建议</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#联想电脑无法无线上网的解决方案" class="sidebar-link">联想电脑无法无线上网的解决方案</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#镜像换源" class="sidebar-link">镜像换源</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#更新apt索引" class="sidebar-link">更新apt索引</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#jdk" class="sidebar-link">jdk</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#vscode" class="sidebar-link">vscode</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#hadoop" class="sidebar-link">hadoop</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#qt" class="sidebar-link">Qt</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#android-studio" class="sidebar-link">android studio</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#主题下载清单" class="sidebar-link">主题下载清单</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#主题设置" class="sidebar-link">主题设置</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#扩展下载清单" class="sidebar-link">扩展下载清单</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#效果图" class="sidebar-link">效果图</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#有用但生疏的命令" class="sidebar-link">有用但生疏的命令</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#" class="sidebar-link"></a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#终端的复制粘贴快捷键" class="sidebar-link">终端的复制粘贴快捷键</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#deb文件安装与卸载" class="sidebar-link">deb文件安装与卸载</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#run文件安装" class="sidebar-link">run文件安装</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#tar-gz文件安装" class="sidebar-link">tar.gz文件安装</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#添加环境变量" class="sidebar-link">添加环境变量</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#清除终端当前输入命令" class="sidebar-link">清除终端当前输入命令</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#查找某个文件的命令" class="sidebar-link">查找某个文件的命令</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#删除软连接" class="sidebar-link">删除软连接</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#查找并杀死进程" class="sidebar-link">查找并杀死进程</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#qt初次编译由于找不到libgl导致失败的解决方案" class="sidebar-link">Qt初次编译由于找不到libGL导致失败的解决方案</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#tar解压命令" class="sidebar-link">tar解压命令</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#查看是否支持cpu虚拟化技术" class="sidebar-link">查看是否支持cpu虚拟化技术</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#对文件-夹-添加权限" class="sidebar-link">对文件（夹）添加权限</a></li><li class="sidebar-sub-header"><a href="/配置记录/Ubuntu１８．０４新手踩雷.html#文件校验" class="sidebar-link">文件校验</a></li></ul></li><li><a href="/配置记录/安装linux虚拟机.html" class="sidebar-link">安装linux实验环境</a></li><li><a href="/配置记录/运行tensorflow使用gpu加速.html" class="sidebar-link">运行tensorflow使用gpu加速</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>思维导图</span> <span class="arrow right"></span></p> <!----></section></li><li><a href="/friend_link.html" class="sidebar-link">友情链接</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><p>人生苦短,何苦入坑</p> <blockquote><p>[toc]</p></blockquote> <h1 id="linux安装篇"><a href="#linux安装篇" class="header-anchor">#</a> Linux安装篇</h1> <p>双系统方案：在已安装win10的笔记本安装Linux，因为咱笔记本有1T机械硬盘的存在，可以大方的给linux分配空间</p> <h2 id="制作启动盘"><a href="#制作启动盘" class="header-anchor">#</a> 制作启动盘</h2> <p>ubuntu18.04 LTS 64位，去官网下载镜像，下载文件后找个工具计算镜像的md5值，检验是否和官网给出的md5校验值一致，如果不一致说明文件下载不完整，有可能在安装时出岔子</p> <p>插上U盘，使用rufus制作启动盘</p> <p><img src="/assets/img/image-20200316181340827.7ed57a52.png" alt="image-20200316181340827"></p> <p>制作盘制作完成，不要拔出U盘</p> <h2 id="分配空间"><a href="#分配空间" class="header-anchor">#</a> 分配空间</h2> <p>在win10磁盘管理工具中右键E盘选择压缩卷腾出200g空间</p> <p><img src="/assets/img/image-20200316181103877.42e0bd70.png" alt="image-20200316181103877"></p> <h2 id="u盘启动"><a href="#u盘启动" class="header-anchor">#</a> U盘启动</h2> <p>重启电脑，闪过开机动画前疯狂按F12，进入U盘快速启动模式，选择代表U盘的磁盘启动(非Windows Boot Manager项)</p> <p>点击Try Ubuntu Without Install，进入ubuntu系统，桌面有安装系统的快捷方式，打开它，跟着指示完成系统安装，安装的过程比较漫长。</p> <h2 id="安装建议"><a href="#安装建议" class="header-anchor">#</a> 安装建议</h2> <p>选择自定义安装（Custom）</p> <p>建议分区方案：</p> <p>/efi: 256MB（系统引导必须，大了没用）</p> <p>swap：2GB（只有内存不足时才会临时用来充当内存，由于本身是硬盘，IO速度肯定不如内存，用到swap时说明处在一个糟糕的状况了。如果你肯定平时不会80%以上内存占用，设多小都没关系）</p> <p>/：剩余所有都给它就对了，home之类的逻辑分区可以不用特地设置</p> <p>小白不要选最小化安装，到时缺这缺那还得手动安装</p> <p>安装时选择简体中文（为了得到省心的中文预设），安装完再改回英文（在文本界面出现中文会乱码显示）</p> <h2 id="联想电脑无法无线上网的解决方案"><a href="#联想电脑无法无线上网的解决方案" class="header-anchor">#</a> 联想电脑无法无线上网的解决方案</h2> <p>只在联想游戏本安装fedora系统时遇过。</p> <p>在 <code>/etc/rc.local</code>文件添加命令</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment">#因为使用的是非管理员登录，故在执行sudo命令时要输入密码，方可自动化执行，</span>
<span class="token comment">#此处假设用户密码为123，命令一定要在exit 0之前运行，该文件如果没有修改权限</span>
<span class="token comment">#修改前使用 chmod 命令修改权限即可！</span>
<span class="token builtin class-name">echo</span> <span class="token string">&quot;123&quot;</span> <span class="token operator">|</span><span class="token function">sudo</span> modprobe -r ideapad_laptop
<span class="token builtin class-name">exit</span> <span class="token number">0</span>
</code></pre></div><h2 id="镜像换源"><a href="#镜像换源" class="header-anchor">#</a> 镜像换源</h2> <p>清华源<code>https://mirrors.tuna.tsinghua.edu.cn</code>，2020/03/16写此文时仍可用。</p> <p>通过SoftWare&amp;Updates的GUI软件更改，是的没错，不需要用手动修改sources.list文件。如果非要改文件，建议备份一下原文件，免得 被玩坏了</p> <p>备份原文件命令</p> <p><code>sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak</code></p> <p>SoftWare&amp;Updates界面</p> <p><img src="/assets/img/image-20200318191938025.4338e90b.png" alt="image-20200318191938025"></p> <h2 id="更新apt索引"><a href="#更新apt索引" class="header-anchor">#</a> 更新apt索引</h2> <div class="language- extra-class"><pre class="language-text"><code>sudo apt update
</code></pre></div><h1 id="配置开发工具篇"><a href="#配置开发工具篇" class="header-anchor">#</a> 配置开发工具篇</h1> <h2 id="jdk"><a href="#jdk" class="header-anchor">#</a> jdk</h2> <p>尽管现在都出到jdk13了，jdk11也有很多人用了，但jdk11与jdk8的差异较大，一些软件使用jdk11以上的jre可能会出错，所以还是要装一个jdk8，最好在国内镜像站点下载，比如 https://mirrors.huaweicloud.com/java/jdk/<a href="https://mirrors.huaweicloud.com/java/jdk/" target="_blank" rel="noopener noreferrer"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>我下载的是jdk1.8.0_202,download下来的是一个压缩文件,用tar解压到自定义目录下</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">tar</span> -xvf ~/Downloads/jdk-8u202-linux-x64.tar.gz 
</code></pre></div><p>默认解压到当前目录,为了方便管理,我手动移动到了<code>/usr/lib/jvm</code>目录下</p> <p>然后就是设置环境变量了</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">vim</span> ~/.bashrc
</code></pre></div><p>编辑内容</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token builtin class-name">export</span> <span class="token assign-left variable">JAVA_HOME</span><span class="token operator">=</span>/usr/lib/jvm/jdk1.8.0_162
<span class="token builtin class-name">export</span> <span class="token assign-left variable">JRE_HOME</span><span class="token operator">=</span><span class="token variable">${JAVA_HOME}</span>/jre
<span class="token builtin class-name">export</span> <span class="token assign-left variable">CLASSPATH</span><span class="token operator">=</span>.:<span class="token variable">${JAVA_HOME}</span>/lib:<span class="token variable">${JRE_HOME}</span>/lib
<span class="token builtin class-name">export</span> <span class="token assign-left variable"><span class="token environment constant">PATH</span></span><span class="token operator">=</span><span class="token variable">${JAVA_HOME}</span>/bin:<span class="token environment constant">$PATH</span>
</code></pre></div><h2 id="vscode"><a href="#vscode" class="header-anchor">#</a> vscode</h2> <p>去官网下载的是deb包，别通过双击打开进行安装，可能会卡死，deb包的安装命令</p> <div class="language- extra-class"><pre class="language-text"><code>sudo dpkg -i &lt;path/filename&gt;.deb
</code></pre></div><p>啰嗦一句：ubuntu的文件管理器叫nautilus，默认情况地址栏的路径是复制不了的，需要按<code>ctrl+l</code>临时切换到编辑状态</p> <p><img src="/assets/img/image-20200320094258335.2c4c7d4c.png" alt="image-20200320094258335"></p> <p><img src="/assets/img/image-20200320094441419.7540ab75.png" alt="image-20200320094441419"></p> <p>chrome：官网下载的也是deb包</p> <p>lamp：linux环境apache+mysql+php</p> <p>从https://github.com/teddysun/lamp/tree/archive根据提示安装</p> <p><img src="/assets/img/image-20200320201100388.030738ca.png" alt="image-20200320201100388"></p> <p>eclipse：通过软件商店下载吧</p> <p><img src="/assets/img/image-20200320094638244.08bd961a.png" alt="image-20200320094638244"></p> <p>认准这个logo，别下了老版本，下面这个安装可能会出问题</p> <p>![Screenshot from 2020-03-20 09-48-06](./Ubuntu１８．０４新手踩雷/Screenshot from 2020-03-20 09-48-06.png)</p> <h2 id="hadoop"><a href="#hadoop" class="header-anchor">#</a> hadoop</h2> <p>按照这个教程安装http://dblab.xmu.edu.cn/blog/install-hadoop/</p> <h2 id="qt"><a href="#qt" class="header-anchor">#</a> Qt</h2> <p>https://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/5.14/5.14.1/</p> <p>从<a href="https://mirrors.tuna.tsinghua.edu.cn/" target="_blank" rel="noopener noreferrer"> 清华大学开源软件镜像站<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>可以下载，下载的是run文件，授予它执行权限然后运行即可，安装时有个gcc64啥的一定要勾选（别以为系统有了gcc就不需要了，它们不是同一个东西），这个是兼容gcc64的qmake相关的东西，没有这个编译不了</p> <h2 id="android-studio"><a href="#android-studio" class="header-anchor">#</a> android studio</h2> <p>官网给的是压缩包，解压到你想要安装的目录下即可，如果安装在非home目录及子目录，很可能没有写入权限，那就需要sudo了，比如我想要装在 <code>/opt</code>目录下</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">tar</span> -xvf xxxx.tar.xx -C /opt
</code></pre></div><p>想要在启动器打开需要手动在<code>/usr/share/applications</code>目录手动创建<code>filaname.desktop</code>文件，编辑内容如下：</p> <div class="language-ini extra-class"><pre class="language-ini"><code><span class="token selector">[Desktop Entry]</span>
<span class="token constant">Name</span><span class="token attr-value"><span class="token punctuation">=</span>你的应用名字</span>
<span class="token constant">GenericName</span><span class="token attr-value"><span class="token punctuation">=</span>应用的泛用名</span>
<span class="token constant">Exec</span><span class="token attr-value"><span class="token punctuation">=</span>启动程序的命令如/opt/android-studio/bin/studio</span>
<span class="token constant">Terminal</span><span class="token attr-value"><span class="token punctuation">=</span>false</span>
<span class="token constant">Type</span><span class="token attr-value"><span class="token punctuation">=</span>Application</span>
<span class="token constant">StartupNotify</span><span class="token attr-value"><span class="token punctuation">=</span>false</span>
<span class="token constant">Icon</span><span class="token attr-value"><span class="token punctuation">=</span>你的应用的图标文件如/opt/andrioid-studio/bin/studio.png</span>

</code></pre></div><p>name和exec是关键</p> <h1 id="linux美化篇"><a href="#linux美化篇" class="header-anchor">#</a> linux美化篇</h1> <p>主要参考自知乎大神<a href="https://www.zhihu.com/people/l0nGYear" target="_blank" rel="noopener noreferrer">路灯等3248人<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>的博客[^1]</p> <p>美化桌面需要下载的工具</p> <div class="language- extra-class"><pre class="language-text"><code>sudo apt install gnome-tweak-tool gnome-shell-extensions chrome-gnome-shell 
</code></pre></div><p>在chrome浏览器下载一个 <code>gnome shell integration</code></p> <p>刚装完gnome-shell-extensions之后界面奇丑无比</p> <p><img src="/assets/img/image-20200320104652869.89bc0dca.png" alt="image-20200320104652869"></p> <p>需要去主题网站<a href="https://www.gnome-look.org/" target="_blank" rel="noopener noreferrer">gnome-look.org<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>或者github下载喜欢的主题</p> <p>去<a href="https://extensions.gnome.org/" target="_blank" rel="noopener noreferrer">https://extensions.gnome.org/<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>下载喜欢的扩展</p> <h2 id="主题下载清单"><a href="#主题下载清单" class="header-anchor">#</a> 主题下载清单</h2> <p>Mac主题：https://github.com/paullinuxthemer/Mc-OS-themes</p> <p>Mac图标：https://www.gnome-look.org/p/1013714</p> <p><s>登录界面：https://www.gnome-look.org/p/1207015/</s>(没卵用)</p> <p><s>开机界面: https://www.gnome-look.org/p/1344634/</s>(小心电脑启动不了)</p> <h2 id="主题设置"><a href="#主题设置" class="header-anchor">#</a> 主题设置</h2> <p>先把丑不拉几的底部的任务栏(window-list)给删了</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token builtin class-name">cd</span> /usr/share/gnome-shell/extensions
<span class="token function">ls</span> <span class="token operator">|</span> <span class="token function">grep</span> window-list 
</code></pre></div><p><img src="/assets/img/image-20200320124144153.f5b59ff3.png" alt="image-20200320124144153"></p> <p>找到了它的全名，删了删了</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">rm</span> -rf window-list@gnome-shell-extensions.gcampax.github.com

</code></pre></div><p>按　<code>ａｌｔ＋ｆ２</code>，然后输入 <code>r</code> 重启gnome桌面,使修改生效</p> <p>我把<a href="https://github.com/paullinuxthemer/Mc-OS-themes" target="_blank" rel="noopener noreferrer">https://github.com/paullinuxthemer/Mc-OS-themes<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>克隆下来了,里面有很多个仿mac主题(白色,和夜间主题都有,但是夜间主题的定制不是很好,有些面板字体颜色与背景分不开,影响阅读),将主题文件夹主题粘贴到 <code>~/.themes/</code>或者<code>/usr/share/themes/</code>下，将图标文件夹移到 <code>/usr/share/icons/</code>目录下, 然后可以用gnome-tweak-tool设置主题</p> <p>可以吧标题栏的三个按钮移到左边:打开tweaks-&gt;Windows-&gt;Titlebar Buttons-&gt;placement选择left,如图</p> <p><img src="/assets/img/image-20200320130552512.853f0674.png" alt="image-20200320130552512"></p> <p>如果设置的主题的顶部栏有一个难看的白色渐变，可以在该主题对应的gnome-shell.css中的<code>#panel</code>中加入一行代码</p> <div class="language-css extra-class"><pre class="language-css"><code><span class="token selector">#panel #panelActivities.panel-button &gt; *</span> <span class="token punctuation">{</span>
 .....
  <span class="token property">background-gradient-direction</span><span class="token punctuation">:</span> none <span class="token important">!important</span><span class="token punctuation">;</span>
 .....
<span class="token punctuation">}</span>
</code></pre></div><p><img src="/assets/img/image-20200320131349365.49294c20.png" alt="image-20200320131349365"></p> <h2 id="扩展下载清单"><a href="#扩展下载清单" class="header-anchor">#</a> 扩展下载清单</h2> <p>以下扩展可以在chrome插件打开的网站中https://extensions.gnome.org/下载</p> <p><strong>Coverflow alt-tab</strong>：切换窗口预览动画</p> <p><strong>Dash to dock</strong> ：仿mac的底部dock，也可以用plank代替,plank可以在软件商店里下载</p> <p><strong>Blyr</strong>：在Overriew窗口模糊背景</p> <p><strong>Native window placement</strong>：Overview的窗口排列呈不规则排列</p> <p><strong>Poppy Menu</strong>：左上角加一个图标，集成了几个没卵用的选项</p> <p><strong>User themes</strong>：加载<code>~/.themes</code>目录的gnome-shelll.css</p> <p>如果用plank代替dash to dock,需要设置开机自启并关闭dash to dock</p> <p>启动blank后,按住ctrl键不放鼠标右键点击blank栏,打开preferences,设置theme为Transparent, icon Size尽量设大一点,Position设置位底部,Icon zoom要手动开启(这是灵魂所在)</p> <p><img src="/assets/img/image-20200320134704908.1b7a85e9.png" alt="image-20200320134704908"></p> <h2 id="效果图"><a href="#效果图" class="header-anchor">#</a> 效果图</h2> <p>我最终选择的主题如下</p> <p><img src="/assets/img/image-20200320181134921.9b2496f1.png" alt="image-20200320181134921"></p> <p><img src="/assets/img/image-20200320181049854.cfef323f.png" alt="image-20200320181049854"></p> <p><img src="/assets/img/image-20200320180632886.611e6922.png" alt="image-20200320180632886"></p> <p><img src="/assets/img/demo.83402e55.gif" alt="demo.gif"></p> <p>如果追求更进一步的个性化,可以自己修改gnome-shell.css,</p> <h1 id="vim配置篇-有bug"><a href="#vim配置篇-有bug" class="header-anchor">#</a> <s>vim配置篇</s>(有bug)</h1> <p>在linux下工作怎么能少了vim.但vim的预设可能并不符合我们的预期,下面开始魔改</p> <p>下载vundle(vim插件管理器)</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">git</span> clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
</code></pre></div><p>编写配置文件 <code>~/.vimrc</code></p> <p>参考qilimi-1的博客[^2]</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token builtin class-name">set</span> nocompatible              <span class="token string">&quot; 去除VI一致性,必须要添加
filetype off                  &quot;</span> 必须要添加

<span class="token string">&quot; 设置包括vundle和初始化相关的runtime path
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
&quot;</span> 另一种选择, 指定一个vundle安装插件的路径
<span class="token string">&quot;call vundle#begin('~/some/path/here')

&quot;</span> 让vundle管理插件版本,必须
Plugin <span class="token string">'VundleVim/Vundle.vim'</span>

<span class="token string">&quot; 以下范例用来支持不同格式的插件安装.
&quot;</span> 请将安装插件的命令放在vundle<span class="token comment">#begin和vundle#end之间.</span>
<span class="token string">&quot; Github上的插件
&quot;</span> 格式为 Plugin <span class="token string">'用户名/插件仓库名'</span>
Plugin <span class="token string">'tpope/vim-fugitive'</span>
<span class="token string">&quot; 来自 http://vim-scripts.org/vim/scripts.html 的插件
&quot;</span> Plugin <span class="token string">'插件名称'</span> 实际上是 Plugin <span class="token string">'vim-scripts/插件仓库名'</span> 只是此处的用户名可以省略
Plugin <span class="token string">'L9'</span>
<span class="token string">&quot; 由Git支持但不再github上的插件仓库 Plugin 'git clone 后面的地址'
Plugin 'git://git.wincent.com/command-t.git'
&quot;</span> 本地的Git仓库<span class="token punctuation">(</span>例如自己的插件<span class="token punctuation">)</span> Plugin <span class="token string">'file:///+本地插件仓库绝对路径'</span>
Plugin <span class="token string">'file:///home/gmarik/path/to/plugin'</span>
<span class="token string">&quot; 插件在仓库的子目录中.
&quot;</span> 正确指定路径用以设置runtimepath. 以下范例插件在sparkup/vim目录下
Plugin <span class="token string">'rstacruz/sparkup'</span>, <span class="token punctuation">{</span><span class="token string">'rtp'</span><span class="token builtin class-name">:</span> <span class="token string">'vim/'</span><span class="token punctuation">}</span>
<span class="token string">&quot; 安装L9，如果已经安装过这个插件，可利用以下格式避免命名冲突
Plugin 'ascenator/L9', {'name': 'newL9'}

&quot;</span> 你的所有插件需要在下面这行之前
call vundle<span class="token comment">#end()            &quot; 必须</span>
filetype plugin indent on    <span class="token string">&quot; 必须 加载vim自带和插件相应的语法和文件类型相关脚本
&quot;</span> 忽视插件改变缩进,可以使用以下替代:
<span class="token string">&quot;filetype plugin on
&quot;</span>
<span class="token string">&quot; 常用的命令
&quot;</span> :PluginList       - 列出所有已配置的插件
<span class="token string">&quot; :PluginInstall  	 - 安装插件,追加 <span class="token variable"><span class="token variable">`</span><span class="token operator">!</span><span class="token variable">`</span></span> 用以更新或使用 :PluginUpdate
&quot;</span> :PluginSearch foo - 搜索 foo <span class="token punctuation">;</span> 追加 <span class="token variable"><span class="token variable">`</span><span class="token operator">!</span><span class="token variable">`</span></span> 清除本地缓存
<span class="token string">&quot; :PluginClean      - 清除未使用插件,需要确认; 追加 <span class="token variable"><span class="token variable">`</span><span class="token operator">!</span><span class="token variable">`</span></span> 自动批准移除未使用插件
&quot;</span>
<span class="token string">&quot; 查阅 :h vundle 获取更多细节和wiki以及FAQ
&quot;</span> 将你自己对非插件片段放在这行之后
</code></pre></div><p>下面是我安装的插件</p> <div class="language-bash extra-class"><pre class="language-bash"><code> <span class="token builtin class-name">set</span> nocompatible
  filetype off
  <span class="token builtin class-name">set</span> <span class="token assign-left variable">rtp</span><span class="token operator">+=</span>~/.vim/bundle/Vundle.vim
  call vundle<span class="token comment">#begin()</span>
  Plugin <span class="token string">'VundleVim/Vundle.vim'</span>
  Plugin <span class="token string">'kien/rainbow_parentheses.vim'</span>
  Plugin <span class="token string">'vim-airline/vim-airline'</span>
  Plugin <span class="token string">'preservim/nerdtree'</span>
  Plugin <span class="token string">'kien/ctrlp.vim'</span>
 Plugin <span class="token string">'preservim/nerdcommenter'</span>
 Plugin <span class="token string">'altercation/solarized'</span>
 Plugin <span class="token string">'junegunn/fzf.vim'</span>
 Plugin <span class="token string">'mileszs/ack.vim'</span>
 Plugin <span class="token string">'vim-scripts/taglist.vim'</span>
 Plugin <span class="token string">'jiangmiao/auto-pairs'</span>
 Plugin <span class="token string">'ycm-core/YouCompleteMe'</span>
 
 call vundle<span class="token comment">#end()</span>
 filetype plugin indent on
 <span class="token string">&quot; 自适应不同语言的智能缩进
 filetype indent on
&quot;</span> 将制表符扩展为空格
 <span class="token builtin class-name">set</span> expandtab
 <span class="token string">&quot; 设置编辑时制表符占用空格数
 set tabstop=4
 &quot;</span> 设置格式化时制表符占用空格数
 <span class="token builtin class-name">set</span> <span class="token assign-left variable">shiftwidth</span><span class="token operator">=</span><span class="token number">4</span>
 &quot; 让 <span class="token function">vim</span> 把连续数量的空格视为一个制表符
 <span class="token builtin class-name">set</span> <span class="token assign-left variable">softtabstop</span><span class="token operator">=</span><span class="token number">4</span>
 <span class="token builtin class-name">set</span> number
</code></pre></div><p>进行插件安装</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">vim</span> +PluginInstall +qall
</code></pre></div><h1 id="linux终端命令工具篇"><a href="#linux终端命令工具篇" class="header-anchor">#</a> Linux终端命令工具篇</h1> <p>有很多大佬写了在命令行上运行的有趣的命令,介绍一下</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> cmatrix<span class="token comment">#类似黑客帝国的字节流</span>
</code></pre></div><p><img src="/assets/img/image-20200320170335844.33f0b937.png" alt="image-20200320170335844"></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> toilet<span class="token comment">#用字母拼成大字符,可惜不支持中文</span>
</code></pre></div><p><img src="/assets/img/image-20200320170734970.13b4d4e5.png" alt="image-20200320170734970"></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> <span class="token function">install</span> libaa-bin<span class="token comment">#字符火焰</span>
aafire
</code></pre></div><p><img src="/assets/img/image-20200320170959489.d499d305.png" alt="image-20200320170959489"></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> sl<span class="token comment"># 跑火车</span>
</code></pre></div><p><img src="/assets/img/image-20200320171154553.d5e77034.png" alt="image-20200320171154553"></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> cowsay<span class="token comment"># cow说的</span>

</code></pre></div><p><img src="/assets/img/image-20200320171353695.4dd3e6b3.png" alt="image-20200320171353695"></p> <h1 id="常备软件篇"><a href="#常备软件篇" class="header-anchor">#</a> 常备软件篇</h1> <p>Document Viewer：pdf阅读器，功能并不强大，胜在轻便，且ubuntu自带，将就着用</p> <p>WPS：office套件</p> <p>typora：markdown写作神器</p> <p>chrome：网页开发或日常上网的必备工具</p> <p>wine：运行windos程序</p> <p>搜狗输入法：中文输入法虽然有ibus输入法，但我们需要搜狗强大的词库</p> <p>百度网盘：电脑必装的好吧</p> <p>还有个录屏软件是ubuntu自带的，在系统设置配置快捷键时可以找到，<code>ctrl+shift+alt+r</code>启动、关闭录屏，输出格式为webm，为了方便可以把它改成 <code>win+R</code></p> <h1 id="linux学习资料篇"><a href="#linux学习资料篇" class="header-anchor">#</a> Linux学习资料篇</h1> <p>Linux就该这么学</p> <p>Unix环境高级编程</p> <h1 id="命令篇"><a href="#命令篇" class="header-anchor">#</a> 命令篇</h1> <p>设置环境变量:修改<code>/etc/profile</code> 或者 <code>~/.profile</code></p> <p>刷新列表</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token builtin class-name">source</span> /etc/bashrc
或者
<span class="token builtin class-name">source</span> ~/.profile
</code></pre></div><h2 id="有用但生疏的命令"><a href="#有用但生疏的命令" class="header-anchor">#</a> 有用但生疏的命令</h2> <h3 id="wget下载github的一个文件"><a href="#wget下载github的一个文件" class="header-anchor">#</a> wget下载github的一个文件</h3> <p>比如下载这个网址的文件:<code>https://github.com/rattonlzh/rattonlzh.github.io/blob/master/homepage/main.css</code>
将网址替换成<code>https://raw.githubusercontent.com/rattonlzh/rattonlzh.github.io/blob/master/homepage/main.css</code>,然后wget即可</p> <div class="language- extra-class"><pre class="language-text"><code>wget  https://raw.githubusercontent.com/rattonlzh/rattonlzh.github.io/blob/master/homepage/main.css
</code></pre></div><h3 id="生成gitee的ssh公钥"><a href="#生成gitee的ssh公钥" class="header-anchor">#</a> 生成gitee的ssh公钥</h3> <p>参考<a href="https://gitee.com/help/articles/4191#article-header0" target="_blank" rel="noopener noreferrer">设置账户SSH公钥<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <div class="language- extra-class"><pre class="language-text"><code>ssh-keygen -t rsa -C &quot;xxxxx@xxxxx.com&quot;  
</code></pre></div><p>第一次询问保存路径,默认是 <code>~/.ssh/id_rsa</code></p> <p>第二次和第三次询问直接按回车即可</p> <p>然后打印公钥信息</p> <div class="language- extra-class"><pre class="language-text"><code>cat ~/.ssh/id_rsa.pub
</code></pre></div><p>将ssh-rsa开头到邮箱名前面的字符复制,粘贴到gitee上个人设置的SSH公钥处即可,标题建议起当前电脑的名字以示区分</p> <p>使用ssh连接默认使用 <code>~/.ssh/id_rsa</code>的私钥,如果有多个ssh私钥,并且希望连接不同平台的远程仓库使用不同的私钥,应做以下配置</p> <ol><li>比如我要在连接gitee.com时,使用<code>gitee_id_rsa</code>私钥,则输入<div class="language- extra-class"><pre class="language-text"><code>ssh-add ~/.ssh/gitee_id_rsa
</code></pre></div></li> <li>编辑<code>~/.ssh/config</code></li></ol> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># gitee</span>
Host gitee
HostName gitee.com
User <span class="token function">git</span> 
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee_id_rsa
</code></pre></div><p>现在测试链接</p> <div class="language- extra-class"><pre class="language-text"><code>ssh -T gitee.com
</code></pre></div><p>如果发现返回了你在gitee的用户名,说明配置成功</p> <h3 id="校验md5-结果以大写形式输出"><a href="#校验md5-结果以大写形式输出" class="header-anchor">#</a> 校验md5(结果以大写形式输出)</h3> <div class="language- extra-class"><pre class="language-text"><code>md5sum &lt;path&gt;/&lt;file&gt; | tr &quot;a-z&quot; &quot;A-Z&quot;
</code></pre></div><p>将文本文件的匹配内容全部替换成其他内容</p> <div class="language- extra-class"><pre class="language-text"><code>sed -i &quot;s/shan/hua/g&quot;  lishan.txt
</code></pre></div><p>grep查找当前目录搜索文件(用来检查大目录下是否存在某文件)</p> <div class="language- extra-class"><pre class="language-text"><code>ls -a | grep &quot;name&quot;
#name采用正则语法
</code></pre></div><h2 id=""><a href="#" class="header-anchor">#</a></h2> <h2 id="终端的复制粘贴快捷键"><a href="#终端的复制粘贴快捷键" class="header-anchor">#</a> 终端的复制粘贴快捷键</h2> <p><code>ctrl+shift+c</code>：复制</p> <p><code>ctrl+shift+v</code>：粘贴</p> <h2 id="deb文件安装与卸载"><a href="#deb文件安装与卸载" class="header-anchor">#</a> deb文件安装与卸载</h2> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> dpkg -i <span class="token operator">&lt;</span>文件名<span class="token operator">&gt;</span>.deb
<span class="token function">sudo</span> dpkg -r <span class="token operator">&lt;</span>文件<span class="token operator">&gt;</span>.deb
</code></pre></div><h2 id="run文件安装"><a href="#run文件安装" class="header-anchor">#</a> run文件安装</h2> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">chmod</span> +x <span class="token operator">&lt;</span>文件名<span class="token operator">&gt;</span>.run
./<span class="token operator">&lt;</span>文件名<span class="token operator">&gt;</span>.run
</code></pre></div><h2 id="tar-gz文件安装"><a href="#tar-gz文件安装" class="header-anchor">#</a> tar.gz文件安装</h2> <p>推荐安装到<code>/opt</code>目录下</p> <p>这是压缩文件，一般解压即可用，但为了可以快捷打开，需要手动设置快捷方式</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">vi</span> /usr/share/applications/<span class="token operator">&lt;</span>程序名<span class="token operator">&gt;</span>.desktop
</code></pre></div><h2 id="添加环境变量"><a href="#添加环境变量" class="header-anchor">#</a> 添加环境变量</h2> <div class="language-bash extra-class"><pre class="language-bash"><code>gedit ~/.bashrc
<span class="token builtin class-name">export</span> <span class="token assign-left variable">QTDIR</span><span class="token operator">=</span>/home/creator/Applications/Qt592/5.9.2/gcc_64
<span class="token builtin class-name">export</span> <span class="token assign-left variable">PKG_CONFIG_PATH</span><span class="token operator">=</span><span class="token variable">$PKG_CONFIG_PATH</span><span class="token builtin class-name">:</span><span class="token variable">$QTDIR</span>/lib/pkgconfig
<span class="token builtin class-name">export</span> <span class="token assign-left variable"><span class="token environment constant">PATH</span></span><span class="token operator">=</span><span class="token variable">$QTDIR</span>/bin:<span class="token environment constant">$PATH</span> 
<span class="token builtin class-name">export</span> <span class="token assign-left variable">LD_LIBRARY_PATH</span><span class="token operator">=</span><span class="token variable">$QTDIR</span>/lib:<span class="token variable">$LD_LIBRARY_PATH</span>
</code></pre></div><div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 创建软连接</span>
<span class="token function">ln</span> -s /usr/lib64/libGL.so.1 /usr/lib/libGL.so
</code></pre></div><h2 id="清除终端当前输入命令"><a href="#清除终端当前输入命令" class="header-anchor">#</a> 清除终端当前输入命令</h2> <p><code>ctrl+u</code>：清除当光标之前的字符</p> <h2 id="查找某个文件的命令"><a href="#查找某个文件的命令" class="header-anchor">#</a> 查找某个文件的命令</h2> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">locate</span> filename
</code></pre></div><h2 id="删除软连接"><a href="#删除软连接" class="header-anchor">#</a> 删除软连接</h2> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">rm</span> -rf <span class="token operator">&lt;</span>link-name<span class="token operator">&gt;</span>　　<span class="token comment">#　不删除实际内容</span>
<span class="token function">sudo</span> <span class="token function">rm</span> -rf <span class="token operator">&lt;</span>link-name<span class="token operator">&gt;</span>/ 　<span class="token comment">#　删除实际内容</span>
</code></pre></div><h2 id="查找并杀死进程"><a href="#查找并杀死进程" class="header-anchor">#</a> 查找并杀死进程</h2> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">ps</span> -aux <span class="token operator">|</span> <span class="token function">grep</span> <span class="token operator">&lt;</span>name<span class="token operator">&gt;</span><span class="token comment"># 查看进程ｉｄ</span>
<span class="token function">kill</span> -s <span class="token operator">&lt;</span>进程ｉｄ<span class="token operator">&gt;</span>
</code></pre></div><h1 id="默认配置篇"><a href="#默认配置篇" class="header-anchor">#</a> 默认配置篇</h1> <h2 id="qt初次编译由于找不到libgl导致失败的解决方案"><a href="#qt初次编译由于找不到libgl导致失败的解决方案" class="header-anchor">#</a> Qt初次编译由于找不到libGL导致失败的解决方案</h2> <p><img src="/assets/img/image-20200318202710971.0b95bb01.png" alt="image-20200318202710971"></p> <p>默认在 <code>/usr/lib</code>目录中查找，但ubuntu的libGL一方面是在其子目录下，另一方面名字后面带有版本号，所以最好的方法是把它找出来并创建一个软链接到 <code>/usr/lib</code> 目录下</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 找到libGL.so文件</span>
<span class="token function">locate</span> libGl.so
</code></pre></div><p><img src="/assets/img/image-20200318203137731.2e6eccdc.png" alt="image-20200318203137731"></p> <p>留意 <code>/usr/lib</code>目录下的，前面两个是32位的，后面两个都是64位的（并不是随便选，发现后面那个1.0.0的库有问题，建议选第一个，如下图），创建软链接</p> <p><img src="/assets/img/image-20200318203719339.d58252e1.png" alt="image-20200318203719339"></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 创建软链接,在/usr目录下创建文件需要root权限</span>
<span class="token function">sudo</span> <span class="token function">ln</span> -s /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0 /usr/lib/libGL.so
</code></pre></div><p><img src="/assets/img/image-20200318204556217.c8ddb894.png" alt="image-20200318204556217"></p> <p>然后就可以正常启动了</p> <h1 id="每日一个linux命令"><a href="#每日一个linux命令" class="header-anchor">#</a> 每日一个linux命令</h1> <h2 id="tar解压命令"><a href="#tar解压命令" class="header-anchor">#</a> tar解压命令</h2> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 版本:1.29,不需要加上解压类型的参数,可以自动识别tar的压缩类型</span>
<span class="token function">tar</span> -xvf <span class="token operator">&lt;</span>file<span class="token operator">&gt;</span>.tar.gz
<span class="token function">tar</span> -xvf <span class="token operator">&lt;</span>file<span class="token operator">&gt;</span>.tar.xz
<span class="token function">tar</span> -xvf <span class="token operator">&lt;</span>file<span class="token operator">&gt;</span>.tar.Z
<span class="token function">tar</span> -xvf <span class="token operator">&lt;</span>file<span class="token operator">&gt;</span>.tar.bz2
<span class="token comment"># 加上-C可以指定解压路径</span>
</code></pre></div><h2 id="查看是否支持cpu虚拟化技术"><a href="#查看是否支持cpu虚拟化技术" class="header-anchor">#</a> 查看是否支持cpu虚拟化技术</h2> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">egrep</span> -c <span class="token string">'(svm|vmx)'</span> /proc/cpuinfo
</code></pre></div><h2 id="对文件-夹-添加权限"><a href="#对文件-夹-添加权限" class="header-anchor">#</a> 对文件（夹）添加权限</h2> <p>1：执行权限</p> <p>2：写权限</p> <p>4：读权限</p> <p>同时拥有几个权限直接将数字相加即可</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">chmod</span> <span class="token number">777</span> /dev/kvm
<span class="token comment"># 7代表同时拥有执行，读，写权限，第一个7表示用户权限，第二个7表示用户组的权限，第三个7表示其他用户权限（其他用户指除了执行这行命令的用户）</span>
</code></pre></div><h2 id="文件校验"><a href="#文件校验" class="header-anchor">#</a> 文件校验</h2> <div class="language-bash extra-class"><pre class="language-bash"><code>shasum -a <span class="token number">256</span> <span class="token operator">&lt;</span>filename<span class="token operator">&gt;</span><span class="token comment">#使用sha256算法计算文件校验和</span>
shasum -c checksum.txt<span class="token comment">#checksum.txt是校验和文件,与被校验文件放在同一个目录,里面的内容的格式是:&lt;算法名称&gt; &lt;校验和&gt; &lt;被校验文件的文件名&gt;</span>
md5sum -c checksum.txt<span class="token comment">#同上</span>
</code></pre></div><h1 id="吐槽"><a href="#吐槽" class="header-anchor">#</a> 吐槽</h1> <p>OS:Ubuntu18.04 LTS Desktop 64bits</p> <p>kernel version: 5.3.0-42-generic</p> <p>自带的截图工具的复制当前窗口截图到剪切板的快捷键经常失灵</p> <p>文件管理器nautilus没有右键复制文件完整路径的功能</p> <p>nautilus没有一键sudo的功能</p> <p>不能开机自动挂载ntfs分区(另外一个系统的分区)</p> <p>截图不能选择保存路径,不能立即进行图文标注和模糊</p> <p>document viewer不能对书签重命名,不能快捷键打开书签</p> <p>zathura不能对在pdf上做笔记</p> <p>按win键(super键)调出的搜索框不能通过输入路径来在此处打开文件管理器,bash或vscode</p> <p>相册不能对图片评级,分级浏览</p> <p>没有一个保存密码的库,可以保存各处的密码,可以随机生成密码</p> <p>搜狗输入法拼音输入出现乱码,尽管切换到英文状态再切回来可以恢复,但影响体验</p> <p>自带的ibus拼音输入法不能按tab/shift+tab翻页</p> <p><img src="/assets/img/image-20200325165011451.55a06915.png" alt="image-20200325165011451"></p> <p>flameshot截图不能进行文本编辑</p> <h1 id="参考资料"><a href="#参考资料" class="header-anchor">#</a> 参考资料</h1> <p>[^1]:<a href="https://zhuanlan.zhihu.com/p/37852274" target="_blank" rel="noopener noreferrer">教程：为你的linux桌面带来Mac OS Mojave的体验<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>
[^2]:<a href="https://blog.csdn.net/qilimi1053620912/article/details/90484379" target="_blank" rel="noopener noreferrer">vim插件管理器：Vundle的介绍及安装<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>
[^3]:<a href="http://www.aqee.net/post/10-funny-liunx-command.html" target="_blank" rel="noopener noreferrer">动画演示10个有趣但毫无用处的Linux命令<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>
[^4]:<a href="https://blog.csdn.net/h8y0bDJVUkwE1LboZlE/article/details/103397074" target="_blank" rel="noopener noreferrer">10款好用到爆的Vim插件，你知道几个？<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></div> <footer class="page-edit"><!----> <!----> <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh"><img alt="知识共享许可协议" src="" style="border-width:0"></a><br>本作品采用<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">知识共享署名 4.0 国际许可协议</a>进行许可。

   
</footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/配置记录/lnmp安装.html" class="prev">
        一条命令开启lnmp
      </a></span> <span class="next"><a href="/配置记录/安装linux虚拟机.html">
        安装linux实验环境
      </a>
      →
    </span></p></div>  <footer style="text-align:center;">备案号： 粤ICP备2021020303号</footer></main></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.c7d9ff18.js" defer></script><script src="/assets/js/2.cd56dec9.js" defer></script><script src="/assets/js/5.80c2b38b.js" defer></script>
  </body>
</html>
